home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / UUCP / UUCon / Source / SweepView.m < prev    next >
Text File  |  1992-11-10  |  2KB  |  67 lines

  1. /*
  2.  
  3.   Ronin Consulting, Inc.
  4.     Copyright (C) 1992, Nicholas Christopher (nwc@gun.com)
  5.  
  6.     This library is free software; you can redistribute it and/or
  7.     modify it under the terms of the GNU Library General Public
  8.     License as published by the Free Software Foundation; either
  9.     version 2 of the License, or (at your option) any later version.
  10.  
  11.     This library is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.     Library General Public License for more details.
  15.  
  16.     You should have received a copy of the GNU Library General Public
  17.     License along with this library; if not, write to the Free
  18.     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. */
  21. #import "SweepView.h"
  22. #import "sweep.h"
  23. #import <c.h>
  24.  
  25. @implementation SweepView
  26.  
  27. + initialize
  28. {
  29.    [self setVersion: 1];
  30.    return self;
  31. }
  32.  
  33. - initFrame:(const NXRect *)frameRect
  34. {
  35.    [super initFrame:frameRect];
  36.    total = 360;
  37.    stepSize = 1;
  38.    return self;
  39. }
  40.  
  41.  
  42. - drawSelf:(const NXRect *)rects :(int)rectCount
  43. {
  44.    float circleX, circleY, circleRad;
  45.  
  46.    circleRad = (MIN(rects->size.width,rects->size.height) - 2.0)/2.0;
  47.    circleX = (rects->size.width/ 2.0) + rects->origin.x;
  48.    circleY = (rects->size.height/ 2.0) + rects->origin.y;
  49.    PSWsweep(circleX, circleY, circleRad, ratio * (float)total);
  50.  
  51.    return self;
  52. }
  53.  
  54. - increment: sender   
  55. {
  56.     count += stepSize;
  57.     count %= total;
  58.  
  59.     [self setRatio:(float)count/(float)total];
  60.     return self;
  61. }
  62.  
  63.  
  64.  
  65. @end
  66.  
  67.